package com.fita.admin.dao;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Limit;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.fita.entity.order.Order;

import java.util.List;
/**
 * 
 * @author sjh
 *
 */
@Dao("hibernate")
public interface ReportDao {
	
	@Query("SELECT COUNT(*) FROM Order WHERE disabled = false AND status<>'CREATED' ")
	public int count();

	/**
	 * 
	 * @param beginIndex
	 * @param maxResult
	 * @return
	 */
    @Limit
	@Query("FROM Order WHERE disabled = false AND status<>'CREATED'")
	public List<Order> list(@Variable("beginIndex") int beginIndex,@Variable("maxResult") int maxResult);
}
